#region Using

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;

using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Forms;

#endregion

namespace TVC.Modules.Act
{
    public partial class frmNumbericValue : Form
    {
        public frmNumbericValue()
        {
            InitializeComponent();
        }
        public Decimal Value
        {
            get
            {
                return numericUpDown1.Value;
            }
            set
            {
                numericUpDown1.Value = value;
                numericUpDown1.Select(numericUpDown1.Value.ToString().Length, 0);
            }
        }

        public int ItemIndex { get; set; }

      
        public delegate void OnKeyEnterHandle();
        public event OnKeyEnterHandle OnKeyEnter;

        private void numericUpDown1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\n' || e.KeyChar == '\t' || e.KeyChar == '\r')
            {
                Close();
                if (OnKeyEnter != null)
                    OnKeyEnter();
            }
        }
    }
}